import request from "@/utils/request";

/* /backAdmin/informationApi/supervise/information/add */

//

// ​/backAdmin​/informationApi​/dept​/user​/list

// 部门员工列表
export function informationApideptuserlist(departmentId) {
  return request({
    url: `/backAdmin/informationApi/dept/user/list?departmentId=${departmentId}`,
    method: "post",
  });
}

// 商家部门列表
export function informationApimerchantdeptlist(merchantId) {
  return request({
    url: `/backAdmin/informationApi/merchant/dept/list?merchantId=${merchantId}`,
    method: "post",
  });
}

// 接收人列表
export function informationApimerchantuserlist(dailyInformationId) {
  return request({
    url: `/backAdmin/informationApi/information/list/receive/user?dailyInformationId=${dailyInformationId}`,
    method: "get",
  });
}

//办公事务发布
export function superviseInformationAdd(data) {
  return request({
    url: `/backAdmin/informationApi/supervise/information/add`,
    method: "post",
    data,
  });
}

//办公事务
export function superviseInformationList(query) {
  return request({
    url: `/backAdmin/informationApi/supervise/information/list`,
    method: "get",
    params: query,
  });
}

//信息接收列表
export function listReceive(query) {
  return request({
    url: `/backAdmin/informationApi/information/receive/list`,
    method: "get",
    params: query,
  });
}

//重要通知列表
export function listCompany(query) {
  return request({
    url: "/backAdmin/informationApi/company/list",
    method: "get",
    params: query,
  });
}
//重要通知修改
export function updateCompany(data) {
  return request({
    url: "/backAdmin/informationApi/company/update",
    method: "post",
    data,
  });
}
//重要通知添加
export function addCompany(data) {
  return request({
    url: `/backAdmin/informationApi/company/add`,
    method: "post",
    data: data,
  });
}

// 商家系统公告列表
export function informationApimerchantsystemlist(query) {
  return request({
    url: "/backAdmin/informationApi/merchant/system/list",
    method: "get",
    params: query,
  });
}

//系统服务列表
export function listSystem(query) {
  return request({
    url: "/backAdmin/informationApi/system/list",
    method: "get",
    params: query,
  });
}
//系统服务修改
export function updateSystem(data) {
  return request({
    url: "/backAdmin/informationApi/system/update",
    method: "post",
    data,
  });
}
//系统服务添加
export function addSystem(data) {
  return request({
    url: `/backAdmin/informationApi/system/add`,
    method: "post",
    data: data,
  });
}

// 删除信息
export function delNotice(dailyInformationIdList) {
  return request({
    url: `/backAdmin/informationApi/information/delete?dailyInformationIdList=${dailyInformationIdList}`,
    method: "post",
  });
}

// 信息列表
export function listNotice(query) {
  return request({
    url: "/backAdmin/informationApi/information/list",
    method: "get",
    params: query,
  });
}
//详情
export function informationApiInformationListReceiveUser(dailyInformationId) {
  return request({
    url: `/backAdmin/informationApi/information/list/receive/user?dailyInformationId=${dailyInformationId}`,
    method: "get",
  });
}

// 新增信息
export function addNotice(data) {
  return request({
    url: `/backAdmin/informationApi/information/add`,
    method: "post",
    data: data,
  });
}

// 停职
export function employeeBandh({ employeeId, isBandh }) {
  return request({
    url: `/backAdmin/employeeApi/bandh?employeeId=${employeeId}&isBandh=${isBandh}`,
    method: "put",
  });
}

// 查询公告详细
export function getNotice(employeeId) {
  return request({
    // url: "/backAdmin/employeeApi/employee/detail?" + employeeId,
    url: `/backAdmin/employeeApi/employee/detail?employeeId=${employeeId}`,
    method: "get",
  });
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: "/backAdmin/employeeApi/employee",
    method: "put",
    data: data,
  });
}
